package com.aolei.mallshop.seckill.scheduled;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.concurrent.CompletableFuture;


@Slf4j
@Component
//@EnableAsync//异步执行
//@EnableScheduling
public class HelloSchedule {

    /**
     * 1、定时任务线程池
     * 2、ComplateFuture
     *
     */
    @Async
    @Scheduled(cron = "*/5 * * ? * 5")
    public void hello(){
        log.info("hello");
    }
}
